package c.c.a;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import org.json.JSONException;
import org.json.JSONObject;

public final class f1 {
    public final SharedPreferences a;

    public f1(Context context) {
        this.a = context.getSharedPreferences("device_register_oaid_refine", 0);
    }

    public e1 a() {
        String string = this.a.getString("oaid", "");
        String str = "hw_id_version_code";
        String str2 = "query_times";
        String str3 = "time";
        String str4 = "take_ms";
        String str5 = "is_track_limited";
        if (TextUtils.isEmpty(string)) {
            return null;
        }
        try {
            JSONObject jSONObject = new JSONObject(string);
            return new e1(jSONObject.optString("id", null), jSONObject.optString("req_id", null), jSONObject.has(str5) ? Boolean.valueOf(jSONObject.optBoolean(str5)) : null, jSONObject.has(str4) ? Long.valueOf(jSONObject.optLong(str4, -1)) : null, jSONObject.has(str3) ? Long.valueOf(jSONObject.optLong(str3, -1)) : null, jSONObject.has(str2) ? Integer.valueOf(jSONObject.optInt(str2, -1)) : null, jSONObject.has(str) ? Long.valueOf(jSONObject.optLong(str, -1)) : null);
        } catch (JSONException e) {
            e.printStackTrace();
            return null;
        }
    }
}
